package com.xhtt.modules.task.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.xhtt.common.file.FileInfoModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 船计划
 * </p>
 *
 * @author feipc
 * @since 2019-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class TaskShipPlan extends Model<TaskShipPlan> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    private String serialNo;

    /**
     * 主任务名称
     */
    private String taskName;

    /**
     * 任务类型1装船2卸船
     */
    private Integer type;

    /**
     * 1待安排2待分配3退回4进行中9完成
     */
    private Integer status;

    private Integer berthId;
    /**
     * 泊位号
     */
    private String berthName;

    /**
     * 预计靠泊时间
     */
    private LocalDateTime berthingDate;

    /**
     * 船名
     */
    private String shipName;

    private String shipCode;//船代

    private String photo;

    private String backReason;//退回理由

    /**
     * 备注
     */
    private String memo;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 最后一次调整时间
     */
    @TableField(update = "now()")
    private LocalDateTime updateTime;

    /**
     * 创建者ID，人工系统创建为0
     */
    private Integer createUserId;

    /**
     * 最后一次调整者ID
     */
    private Integer updateUserId;

    @TableField(exist = false)
    private String products;

    @TableField(exist = false)
    private List<TaskShipPlanProduct> productList;
    @TableField(exist = false)
    private List<FileInfoModel> photoFiles;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
